from config.setting import STATIC_URL
from litestar.openapi.plugins import (
    RapidocRenderPlugin,
    RedocRenderPlugin,
    StoplightRenderPlugin,
    SwaggerRenderPlugin,
)

favicon = f'<link rel="shortcut icon" href="{STATIC_URL}/img/logo.svg">'

swagger_render_plugin = SwaggerRenderPlugin(
    path="/docs",
    favicon=favicon,
    css_url=f"{STATIC_URL}/css/swagger-ui.css",
    js_url=f"{STATIC_URL}/js/swagger-ui-bundle.js",
    standalone_preset_js_url=f"{STATIC_URL}/js/swagger-ui-standalone-preset.js",
)

redoc_render_plugin = RedocRenderPlugin(
    path="/redoc",
    google_fonts=False,
    favicon=favicon,
    js_url=f"{STATIC_URL}/js/redoc.standalone.js",
)

rapid_doc_render_plugin = RapidocRenderPlugin(
    path="/rapidoc",
    favicon=favicon,
    js_url=f"{STATIC_URL}/js/rapidoc-min.js",
)

stop_light_render_plugin = StoplightRenderPlugin(
    path="/elements",
    favicon=favicon,
    css_url=f"{STATIC_URL}/css/spotlight-styles.mins.css",
    js_url=f"{STATIC_URL}/js/spotlight-web-components.min.js",
)
